import { BaseWindow } from "../../../component/window/BaseWindow";
import { ILayer } from "../../../mvc/interfaces/ILayer";
import { Language } from "../../../../extend/language/Language";
import { MuiEvent } from "../../../../com/mui/events/MuiEvent";
import { ObjCreate } from "../common/ObjCreate";
import { UICompomentPool } from "../../../../com/mui/utils/UICompomentPool";
import { GImageButtonTabBar } from "../../../../com/mui/controls/GImageButtonTabBar";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { ImagesConst } from "../../resource/ImagesConst";
import { GImageBitmap } from "../../../../com/mui/controls/GImageBitmap";
//class PetIslandPicRulePanel
    
    export  class PetIslandPicRulePanel extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            this._tabData = [{"name":"spirit0", "styleName":"PetIslandPicRuleLeftBtn"}, {"name":"spirit1", "styleName":"PetIslandPicRuleMiddleBtn"}, {"name":"spirit2", "styleName":"PetIslandPicRuleRightBtn"}, {"name":"spirit3", "styleName":"PetIslandPicRuleFourthBtn"}];
            super(arg1);
            setSize(692, 480);
            titleHeight = 26;
            title = Language.getString(28100);
            return;
        }

        /* internal  */tabBarChangeHandler(arg1: MuiEvent): void
        {
            this._pic.imgUrl = "PetIslandPicRulePic_" + this._imageBtnBar.selectedIndex;
            return;
        }

        protected /* override */ createDisposedChildrenImpl(): void
        {
            super.createDisposedChildrenImpl();
            pushUIToDisposeVec(ObjCreate.createFlowerBg(18, 38, 656, 100, this));
            this._imageBtnBar = UICompomentPool.getUICompoment(GImageButtonTabBar) as GImageButtonTabBar;
            this._imageBtnBar.horizontalGap = 5;
            this._imageBtnBar.buttonWidth = 149;
            this._imageBtnBar.buttonHeight = 61;
            this._imageBtnBar.buttonFilters = [FilterConst.glowFilter];
            this._imageBtnBar.dataProvider = this._tabData;
            this._imageBtnBar.selectedIndex = 0;
            this._imageBtnBar.configEventListener(MuiEvent.GTABBAR_SELECTED_CHANGE, this.tabBarChangeHandler);
            ObjCreate.setObjAttri(this._imageBtnBar, 35, 55, -1, -1, this);
            this._pic = ObjCreate.createGImageBitmap(ImagesConst.PetIslandPicRulePic_0, 18, 142, this);
            return;
        }

        protected /* override */ disposeImpl(arg1: Boolean=true): void
        {
            super.disposeImpl(arg1);
            this._pic.dispose(arg1);
            this._imageBtnBar.dispose(arg1);
            this._pic = null;
            this._imageBtnBar = null;
            return;
        }

        /* internal */ /* var */_pic: GImageBitmap;

        /* internal */ /* var */_imageBtnBar: GImageButtonTabBar;

        /* internal */ /* var */_tabData: Array<any>;
    }
